home *** CD-ROM | disk | FTP | other *** search
- ` -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- ` DarkDistort
- ` -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- ` By Rich Davey (rich@fatal-design.com)
- ` -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- ` Re-creates the classic dist effects
- ` from the ST/Amiga days. Use cursors
- ` to control speed. Change the Z value
- ` below for different effects.
- `
- ` Music listened to while coding this
- ` The Sound of Homelands (Ministry).
- ` -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-
- sync rate 40
- sync on
- hide mouse
-
- ink rgb(255,255,255),rgb(0,0,0)
- center text 320,0,"- DarkForge -"
- center text 320,16,"Use arrow keys to change distortion"
-
- ` You can replace this bitmap with any 320x240 image
-
- load bitmap "zod4.bmp",1
- set current bitmap 1
-
- ` Change the Z value for a smoother distortion effect
- ` it must be a multiple of 2 (i.e. 2, 4, 6, 8, 16)
-
- z=2; y=0
-
- ` Let's grab our bobs!
-
- for i=1 to 240/z-1
-
- get image i,0,y,320,y+z
- bob i,-100,-100,i
- y=y+z
-
- next i
-
- delete bitmap 1
-
- ` Build a basic sine-wave array
-
- dim sine#(360)
-
- for s=0 to 360
- sx#=sin(s)*100
- sine#(s)=sx#
- next s
-
- ` Set-up the initial values
-
- count=240/z; step=1; speed=4; sx=0
-
- set current bitmap 0
-
- do
-
- sync
-
- for a=1 to count
- bob a,150+sine#(wrapvalue(sx+a*step)),120+(a*z),a
- next a
-
- sx=sx+speed
-
- if upkey()
- inc speed
- if speed>64 then speed=64
- endif
-
- if downkey()
- dec speed
- if speed<0 then speed=0
- endif
-
- if leftkey()
- inc step
- if step>16 then step=16
- endif
-
- if rightkey()
- dec step
- if step<0 then step=0
- endif
-
- if spacekey() then end
-
- loop
-
-